<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\CarDealerService;
use think\Db;

class CarDealer extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    // 品牌列表
    public function brand()
    {
        $data = $this->request->post();
        $res = CarDealerService::getBrandList($data);
        return json($res);
    }

    // 车系列表
    public function series()
    {
        $data = $this->request->post();
        $res = CarDealerService::getSeriesList($data);
        return json($res);
    }

    // 车辆型号
    public function model()
    {
        $data = $this->request->post();
        $res = CarDealerService::getModelList($data);
        return json($res);
    }

    // 车辆类别
    public function category()
    {
        $data = $this->request->post();
        $res = CarDealerService::getCategoryList($data);
        return json($res);
    }

    // 我要卖车
    public function sell()
    {
        $data = $this->request->post();
        $res = CarDealerService::sellCar($data);
        return json($res);
    }

    // 售车记录
    public function sell_record()
    {
        $data = $this->request->post();
        $res = CarDealerService::sellRecord($data);
        return json($res);
    }

    // 取消订单
    public function cancel_order()
    {
        $data = $this->request->post();
        $res = CarDealerService::cancelOrder($data);
        return json($res);
    }

    // 已出售
    public function already_sold()
    {
        $data = $this->request->post();
        $res = CarDealerService::alreadySold($data);
        return json($res);
    }

    // 车商认证
    public function car_auth()
    {
        $data = $this->request->post();
        $res = CarDealerService::carAuth($data);
        return json($res);
    }

    // 选择城市
    public function select_city()
    {
        $data = $this->request->post();
        $res = CarDealerService::selectCity($data);
        return json($res);
    }

    // 选择品牌
    public function select_brand()
    {
        $data = $this->request->post();
        $res = CarDealerService::selectBrand($data);
        return json($res);
    }

    // 距离筛选
    public function distance()
    {
        $data = $this->request->post();
        $res = CarDealerService::distance($data);
        return json($res);
    }

    // 车辆详情
    public function car_detail()
    {
        $data = $this->request->post();
        $res = CarDealerService::carDetail($data);
        return json($res);
    }

    // 会员价格
    public function member_price()
    {
        $data = $this->request->post();
        $res = CarDealerService::memberPrice($data);
        return json($res);
    }

    // 开通会员
    public function open_member()
    {
        $data = $this->request->post();
        $res = CarDealerService::openMember($data);
        return json($res);
    }

    // 我的认证
    public function my_auth()
    {
        $data = $this->request->post();
        $res = CarDealerService::myAuth($data);
        return json($res);
    }

    // 修改认证
    public function edit_auth()
    {
        $data = $this->request->post();
        $res = CarDealerService::editAuth($data);
        return json($res);
    }

    // 账单明细
    public function bill_detail()
    {
        $data = $this->request->post();
        $res = CarDealerService::billDetail($data);
        return json($res);
    }

    // 测试回调
    public function test_notifyx()
    {
        $data = $this->request->post();
        $res = CarDealerService::testNotifyx($data);
        return json($res);
    }
}